package com.gitee.wsl.security.digest

interface Mac : Digest {
     override val algorithmName: String
     val macSize: Int

    override val digestSize: Int
        get() = macSize

     override val blockSize: Int

     override fun update(byte: Byte): Mac

     override fun update(source: ByteArray, startIndex: Int, endIndex: Int): Mac

     override fun digest(destination: ByteArray, destinationOffset: Int)

     override fun digest(): ByteArray = ByteArray(macSize).apply {
        digest(this)
    }

     override fun reset()
}

operator fun Mac.plusAssign(byteArray: ByteArray) {
    update(byteArray)
}